/*83856*/
<template>
  <div>
    <h5>父组件调用子组件</h5>
    <el-button @click="callChild">click me</el-button>
    <br>
    <child ref="sonRef" :nums="12" @tclick="tclick"></child>
  </div>
</template>

<script lang="ts" setup>
import {ref, reactive, onMounted, watch} from "vue"
import child from "../List/components/Child.vue"

const sonRef = ref(null);

// 直接调用子组件方法和内容 ，使用defineExpose在子组件中注册公布
const callChild = () => {
  sonRef.value.fn()
  console.log(sonRef.value.a);
}

const tclick = (t) => {
  console.log('click', t)
}

</script>

<style scoped lang="scss">

</style>